﻿function checkForm(form) {
    if (form.KeyWords.value == "") {
        alert("关键字不能为空!");
        return false;
    }
    if (form.ShopName.value == "") {
        alert("店铺名称不能为空!");
        return false;
    }
    if (form.ProductName.value == "") {
        alert("产品名称不能为空!");
        return false;
    }
    if (form.ShopName.value == "") {
        alert("店铺名称不能为空!");
        return false;
    }
    if (form.Url.value == "") {
        alert("连接网址不能为空!");
        return false;
    }
    if (form.Url.value == "") {
        alert("连接网址不能为空!");
        return false;
    }
    var index = document.location.search.indexOf("addshops");
    if (index != -1) {
        if (form.ProductPicture.value == "") {
            alert("图片不能为空!");
            return false;
        }
    }

    if (!isMoney(form.ProductPrice.value)) {
        alert("产品价格不正确!");
        return false;
    }
    if (!isNumber(form.CommitCount.value)) {
        alert("最近成交笔数必须数字!");
        return false;
    }
    if (!isMoney(form.Shipping.value)) {
        alert("运费输入不正确,必须0.00格式!");
        return false;
    }
    if (isNumber(form.Shipping.value)) {
        alert("数量必须数字!");
        return false;
    }
    var act = "RequestHandler.ashx" + document.location.search + "&t=tb";
    var index = document.location.search.indexOf("editshop");
    if (index != -1)
        act = "RequestHandler.ashx" + document.location.search.replace("editshop", "updateshop") + "&t=tb";
    form.action = act;
    form.submit();
}